package com.zpark.drug.pojo;

import com.zpark.drug.common.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 进货记录表
 */
@Table(name = "purchase_records")
public class PurchaseRecords {
    @Id
    @Column(name = "record_id")
    private Integer id;
    @Column(name = "drug_name")
    private String name;
    @Column(name = "supplier_name")
    private String supplierName;
    @Column(name = "record_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date recordDate;
    @Column(name = "record_quantity")
    private Integer quantity;

    public String getRecordDateStr(){
        return DateUtil.dateConvert(recordDate);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Date getRecordDate() {
        return recordDate;
    }

    public void setRecordDate(Date recordDate) {
        this.recordDate = recordDate;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }
}
